﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Wsitech.Model;
using Wsitech.BLL;

public partial class Backend_ImageDescription : BackendPageBase
{
    public readonly string attachid = HttpContext.Current.Request["attachid"] ?? "";
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            bindDescription(attachid);
        }
    }

    private void bindDescription(string attachid)
    {
        AttachInfo info = AttachInfoBLL.Instance.GetDetail(attachid);
        if (info != null)
        {
            txtDescription.Text = info.Description;
        }
    }


    protected void UpdateDescription(object sender, EventArgs e)
    {
        AttachInfo info = AttachInfoBLL.Instance.GetDetail(attachid);
        if (info != null)
        {
            info.Description = txtDescription.Text.Trim();

            AttachInfoBLL.Instance.Update(info);
        }
        base.RefreshParent();
    }
}